package com.xhwl.logistics.service.cent;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhwl.common.dto.cent.eesd.EnvStatisticsReqDTO;
import com.xhwl.common.dto.cent.eesd.EnvStatisticsReqV2DTO;
import com.xhwl.common.dto.cent.vehicle.feign.*;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.bi.DwdDimChargeMetrics;
import com.xhwl.common.pojo.cent.vehicle.po.VehicleCarportRecordIntervalStatisticsPO;
import com.xhwl.common.vo.cent.vehicle.bi.VehicleAccessRecordIntervalStatisticsVO;
import com.xhwl.common.vo.cent.vehicle.bi.VehicleCarSpotHourVO;
import com.xhwl.common.vo.cent.vehicle.bi.VehicleStatisticsVO;
import feign.Param;
import feign.RequestLine;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;

//@FeignClient(value = "cent-bi")
public interface IBIVehicleService {

    @RequestLine(value = "POST /logistics-feign/dws-access-record-hour/insert")
    void addDwsAccessRecordForHour(@Param("dws-access-record-hour") CreateBiVehicleAccessRecordHourFeignDTO createBiVehicleAccessRecordHourFeignDTO);

    @RequestLine(value = "POST /logistics-feign/dws-card-access-record-hour/insert")
    void addDwsCardAccessRecordForHour(@Param("dws-card-access-record-hour") CreateBiVehicleCardAccessRecordHourFeignDTO createBiVehicleCardAccessRecordHourFeignDTO);

    @RequestLine(value = "POST /logistics-feign/dws-pay-record-hour/insert")
    void addDwsPayRecordForHour(@Param("dws-pay-record-hour") CreateBiVehiclePayRecordHourFeignDTO createBiVehiclePayRecordHourFeignDTO);

    @RequestLine(value = "POST /logistics-feign/dws-card-pay-record-hour/insert")
    void addDwsCardPayRecordForHour(@Param("dws-card-pay-record-hour") CreateBiVehicleCardPayRecordHourFeignDTO createBiVehicleCardPayRecordHourFeignDTO);

    @RequestLine(value = "POST /logistics-feign/dws-carport-record-minute/insert")
    void addDwsCarportRecordForHour(@Param("dws-carport-record-minute") CreateBiVehicleCarportRecordMinuteFeignDTO createBiVehicleCarportRecordMinuteFeignDTO);

    @RequestLine(value = "POST /logistics-feign/dws-access-record-hours/insert")
    void addDwsAccessRecordForHours(@Param("dws-access-record-hours") List<CreateBiVehicleAccessRecordHourFeignDTO> createBiVehicleAccessRecordHourFeignDTOList);

    @RequestLine(value = "POST /logistics-feign/dws-location-access-record-hours/insert")
    void addDwsLocationAccessRecordForHours(@Param("dws-location-access-record-hours") List<CreateBiVehicleLocationAccessRecordHourFeignDTO> createBiVehicleLocationAccessRecordHourFeignDTOList);

    @RequestLine(value = "POST /logistics-feign/dws-pay-record-hours/insert")
    void addDwsPayRecordForHours(@Param("dws-pay-record-hours") List<CreateBiVehiclePayRecordHourFeignDTO> createBiVehiclePayRecordHourFeignDTOList);

    //BI中台的feign接口，向车位统计表中修改数据
    @RequestLine(value = "POST /logistics-feign/dws-car-spot-hour/alter")
    void alterDwsCarSpotForHour(@Param("dws-car-spot-hour") CreateBiVehicleCarSpotHourFeignDTO createBiVehicleCarSpotHourFeignDTO);

    //BI中台的feign接口，向车位统计表中插入数据
    @RequestLine(value = "POST /logistics-feign/dws-car-spot-hour/insert")
    void addDwsCarSpotForHour(@Param("dws-car-spot-hour") List<CreateBiVehicleCarSpotHourFeignDTO> createBiVehicleCarSpotHourFeignDTOList);

    //BI中台的feign接口，通过统计时间来查询车位统计信息
    @RequestLine(value = "POST /logistics-feign/dws-car-spot-hour/get")
    List<VehicleCarSpotHourVO> checkCarSpotHour(@Param("dws-car-spot-hour") CreateBiVehicleCarSpotHourFeignDTO createBiVehicleCarSpotHourFeignDTO);

    //BI中台的feign接口，获取进出记录的统计趋势
    @RequestLine(value = "POST /logistics-feign/access-record/trend")
    VehicleStatisticsVO<List<VehicleAccessRecordIntervalStatisticsVO>> accessRecordIntervalStatistics(
            @Param("interval") VehicleIntervalStatisticsQuery vehicleIntervalStatisticsQuery);

    //BI中台：向按车辆类型统计表中插入一条数据
    @RequestLine(value = "POST /logistics-feign/dws-access-record-cartype/add")
    void addDwsAccessRecordCartypeForHour(@Param("dws-access-record-cartype-hour") CreateBiVehicleAccessRecordCartypeHourFeignDTO createBiVehicleAccessRecordCartypeHourFeignDTO);

    /**
     * 电量、充电订单、利用趋势
     *
     * @param dto
     * @return
     */
    @RequestLine(value = "POST /eesd/charge/trend")
    ResultJson<Map<Integer, Object>> chargeTrend(@RequestBody @Valid EnvStatisticsReqDTO dto);


    /**
     * 电量、充电订单、利用趋势统计(按时间查询)
     *
     * @param dto
     * @return
     */
    @RequestLine(value = "POST /v2/eesd/charge/trend")
    ResultJson<Page<DwdDimChargeMetrics>> chargeTrendV2(@RequestBody @Valid EnvStatisticsReqV2DTO dto);

    /**
     * 根据项目ID查询车位信息
     * @param projectIds
     * @return
     */
    @RequestLine(value = "POST /logistics-feign/query-carport-by-proj")
    List<VehicleCarportRecordIntervalStatisticsPO> queryCarportInfoByProj(@Param("projectIds") List<Integer> projectIds);
}
